function getProperty<T , K extends keyof T>(obj:T, key:K){
  return obj[key]
}

let x3 = {
  a:1,
  b:2,
  c:3,
  d:4
}
getProperty(x3,'a')
getProperty(x3,'m')